<#include "../common/layout.ftl"/>
<@layout>
<div class="well">
<script type="text/javascript" src="/js/jquery.form.js"></script>
	<span class="label label-success">报名详情</span>
	<form id="form1" class="well form-horizontal" action=""  method="post">
	  <table  class="control-group">
	     <tr>
	     	<input type="hidden" name="bUserEnroll.id" value=${driver.id }>
	        <td><label class="control-label" for="focusedInput">工号：</label></td>
	        <td><input class="input-xlarge focused" name="job_number" id="job_number" type="text" ></td>
	        
	        <td><label class="control-label" for="focusedInput">密码：</label></td>
	        <td><input class="input-xlarge focused" name="pwd" id="password" type="text" ></td>
	     </tr>
	     
	     
	      
	      <tr>
	        <td><label class="control-label" for="focusedInput">真实姓名：</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.name" id="realname" type="text"  style="height: 26" value=${driver.name!"" }  ></td>
	        
	        <td><label class="control-label" for="focusedInput">手机号码：</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.phone" id="cellphone" type="text"  style="height: 26"  value=${ driver.phone}></td>
	     </tr>
	     
	     <tr>
	        <td><label class="control-label" for="focusedInput">所属公司：</label></td>
	        <td>
	            <select id="compano" name="compano">
              </select>
	        </td>
	        <td><label class="control-label" for="focusedInput">身份证号码：</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.id_card" id="id_card" type="text"  style="height: 26" value=${driver.id_card }  ></td>
	     </tr>
	      <!--
	      <tr>
	        <td><label class="control-label" for="focusedInput">银行卡号：</label></td>
	        <td><input class="input-xlarge focused" name="driver.bank_no" id="id_card" type="text"  style="height: 26"  ></td>
	        
	        <td><label class="control-label" for="focusedInput">MAC地址：</label></td>
	        <td><input class="input-xlarge focused" name="driver.mac" id="mac" type="text"  style="height: 26"  ></td>
	     </tr-->
	     
	     <tr>
	        <td><label class="control-label" for="focusedInput">籍贯：</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.hometown" id="hometown" type="text"  style="height: 26" value=${driver.hometown }  ></td>
	        
	        <td><label class="control-label" for="focusedInput">年龄：</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.age" id="age"  type="text"  style="height: 26" value=${driver.age }  ></td>
	     </tr>
	     
	      <tr>
	        <td><label class="control-label" for="focusedInput">驾龄：</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.driver_age" id="driver_age"  type="text"  value=${driver.driver_age }  ></td>
	        
	        <td><label class="control-label" for="focusedInput">驾照：</label></td>
	        <td>
	            <select id="sex" name="bUserEnroll.driver_license">
                <option value="A1" <#if driver.driver_license=='A1'>selected</#if>>A1</option>
                <option value="A2" <#if driver.driver_license=='A2'>selected</#if>>A2</option>
                <option value="A3" <#if driver.driver_license=='A3'>selected</#if>>A3</option>
                <option value="B1" <#if driver.driver_license=='B1'>selected</#if>>B1</option>
                <option value="B2" <#if driver.driver_license=='B2'>selected</#if>>B2</option>
                <option value="C1" <#if driver.driver_license=='C1'>selected</#if>>C1</option>
                <option value="C2"<#if driver.driver_license=='C2'>selected</#if>>C2</option>
              </select>
	        </td>
	     </tr>
	     
	     <tr>
	        <td><label class="control-label" for="focusedInput">性别：</label></td>
	        <td>
	            <select id="sex" name="bUserEnroll.sex">
                <option value="0" selected>男</option>
                <option value="1">女</option>
                <option value="2">未知</option>
              </select>
	        </td>
	        
	        <td><label class="control-label" for="focusedInput">驾照编号</label></td>
	        <td><input class="input-xlarge focused" name="bUserEnroll.license_num"  type="text"  style="height: 26" value=${driver.license_num }  ></td>
	     </tr>
	     <tr>
	        <td><label class="control-label" for="focusedInput">军衔：</label></td>
	        <td>
	            <input class="input-xlarge focused" name="level" value="" type="text" style="height: 26" >
	        </td>
	        <td><label class="control-label" for="focusedInput">积分：</label></td>
	        <td>
	           <input class="input-xlarge focused" name="point" value="" type="text" style="height: 26" >
	        </td>
	     </tr>
	     <tr>
	     		<td><label class="control-label" for="focusedInput">介绍人</label></td>
	        	<td><input class="input-xlarge focused" name="bUserEnroll.introduce_person"  type="text"  style="height: 26" value=${driver.introduce_person }  ></td>
	        	<td><label class="control-label" for="focusedInput">备注</label></td>
	        	<td><input class="input-xlarge focused" name="bUserEnroll.remark"  type="text"  style="height: 26" id="remark" value=${driver.remark!"" }   ></td>
	     </tr>
	     <tr>
	     	<td>
	     		<label class="control-label" for="focusedInput">报名类型</label>
	     	</td>
	     	<td>
	     		<input name="post" type="checkbox" value="0" <#if driver.flag?index_of("0")!=-1>checked</#if>>代驾员
	     		<input name="post" type="checkbox" value="1"  <#if driver.flag?index_of("1")!=-1>checked</#if>  />配送员
	     		<input name="post" type="checkbox" value="2"  <#if driver.flag?index_of("2")!=-1>checked</#if> />保镖员
	     		<input name="post" type="checkbox" value="3"  <#if driver.flag?index_of("3")!=-1>checked</#if>/>泊车员
	     	</td>
	     </tr>
	     <tr>
	        <td><label class="control-label" for="focusedInput">身份证图片：</label></td>
	        <td>
	            <img style="width:50px;height:50px;" src="/upload/${driver.id_card_img!"default_avatar.gif"}"/>
	            <input type="hidden" name="bUserEnroll.id_card_img" value=${driver.id_card_img!""}>
	        </td>
	        <td><label class="control-label" for="focusedInput">驾照图片：</label></td>
	        <td>
	          <img style="width:50px;height:50px;" src="/upload/${driver.driver_license_img!"default_avatar.gif"}"/>
	          <input type="hidden" name="bUserEnroll.driver_license_img" value=${driver.driver_license_img!""}>
	        </td>
	     </tr>
	  </table>
      
      <div class="form-actions" style="height: 10;float:right" >
      	<#if driver.status==0>
	        <button type="button" class="btn btn-primary" name="pass" id="pass">审核通过</button>
	        <button type="button" class="btn" name="no" id="no" >审核不通过</button>
        </#if>
        <button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
      </div>
  </form>
  </div>

<script>
$(document).ready(function(){ 
	$('#no').click(function(){
		window.location.href="/driver/Ignore?id=${driver.id }&remark="+document.getElementById('remark').value;
	});
	$('#pass').click(function(){
		if($('#job_number').val()==''){
			alert('工号不可为空');
			return;
		}
		if($('#password').val()==''){
			alert('密码不可为空');
			return;
		}
		 $('#form1').ajaxSubmit({
				type:'post',
				url:'/driver/pass',
				success:function(data){
					debugger;
					var code=data.code;
					var msg=data.msg;
					if(code==-1){
						alert(msg);
					}
					else{
						window.location.href="/driver/enroll";
					}
				}
		 });
	});
});
	$(function() { 
	$.ajax({
	    type:'POST',
	    url:"/driver/listLicensenum",
	    dataType:"json",
	    success:function(result){
	    	$(result.record).each(function(){
	    		/*var d="${driver.city!""}";
	    		if($(this).attr('city')==d){
	    			$("#compano").append("<option value='"+$(this).attr('company')+" selected'>"+$(this).attr('companyname')+"</option>");
	    		}
	    		else{*/
	    			$("#compano").append("<option value='"+$(this).attr('company')+"'>"+$(this).attr('companyname')+"</option>");
	    	//	}
	    	});
	    },error:function(result){
	    	alert(result);
	    }
	});
     $("#form1").validity(function() {
         $("#job_number").require();
         $("#password").require();
         $("#realname").require();
         $("#cellphone").require().match("number");
         $("#license_num").require();
         $("#mac").require();
         $("#id_card").require();
         $("#hometown").require();
         $("#license_num").require();
         $("#age").require().match("number");
         $("#driver_age").require().match("number");
         $("#bank_no").require().match("number");
     });
 }); 
</script>
</@layout>